//
//  SASelectAddImageCell.m
//  saasRetail
//
//  Created by mac on 2022/10/23.
//

#import "SASelectAddImageCell.h"

@implementation SASelectAddImageCell

-(instancetype)initWithFrame:(CGRect)frame
{
    if(self  =[super initWithFrame:frame])
    {
        
        [self setUpsUbViews];
    }
    return self;
}
-(void)setUpsUbViews
{
    self.contentView.backgroundColor = [UIColor clearColor];
    
    UIView *mongoliaView = [[UIView alloc] init];
    mongoliaView.userInteractionEnabled = YES;
    mongoliaView.layer.cornerRadius = kScaleNum(5);
    mongoliaView.layer.masksToBounds = YES;
    mongoliaView.backgroundColor = kColor(255, 255, 255, 1);
    [self.contentView addSubview:mongoliaView];
    [mongoliaView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@(kScaleNum(0)));
        make.top.equalTo(@(kScaleNum(0)));
        make.width.mas_equalTo(kScaleNum(60));
        make.height.mas_equalTo(kScaleNum(75));
    }];
    
    UIButton * addImageBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    addImageBtn.frame = CGRectMake(kScaleNum(0), kScaleNum(0), kScaleNum(60), kScaleNum(75));
    [addImageBtn setBackgroundImage:[UIImage imageNamed:@"product_choose_image_add_btn"] forState:UIControlStateNormal];
    [addImageBtn addTarget:self action:@selector(addImageBtnClick) forControlEvents:UIControlEventTouchUpInside];
    [mongoliaView addSubview:addImageBtn];
    self.addImageBtn = addImageBtn;
}

-(void)addImageBtnClick
{
    if (self.addImageBlock) {
        self.addImageBlock();
    }
}

@end
